package database

import (
	"fmt"

	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

func init() {
	dsn := "root:123456@tcp(172.14.1.161:3306)/classmates"
	var err error
	DB, err = gorm.Open(mysql.Open(dsn), &gorm.Config{})
	if err != nil {
		fmt.Println("连接失败")
	}
	fmt.Println(DB)
	fmt.Println("连接成功")
}

var DB *gorm.DB
